package cn.bone.ou.community.controller;

import cn.bone.base.bean.CommonResult;
import cn.bone.ou.community.param.CommitteeParam;
import cn.bone.ou.community.service.ICommitteeService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping("/ou/committee")
public class CommitteeController {

    @Resource
    private ICommitteeService committeeService;

    /**获取业委会信息*/
    @RequestMapping("/get")
    public CommonResult get(@Valid CommitteeParam.GetParam param){
        return committeeService.get(param);
    }

    /**添加业委会*/
    @RequestMapping("/add")
    public CommonResult add(@Valid CommitteeParam.AddParam param){
        return committeeService.add(param);
    }


    /**修改业委会*/
    @RequestMapping("/modify")
    public CommonResult modify(@Valid CommitteeParam.ModifyParam param){
        return committeeService.modify(param);
    }


    /**获取业委会成员列表*/
    @RequestMapping("/listMember")
    public CommonResult listMember(@Valid CommitteeParam.ListMemberParam param){
        return committeeService.listMember(param);
    }

    /**添加成员*/
    @RequestMapping("/addMember")
    public CommonResult addMember(@Valid CommitteeParam.AddMemberParam param){
        return committeeService.addMember(param);
    }

    /**删除成员*/
    @RequestMapping("/deleteMember")
    public CommonResult deleteMember(@Valid CommitteeParam.DeleteMemberParam param){
        return committeeService.deleteMember(param);
    }
}
